package com.example.mybatisplusdemo.model.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * 订单详情
 * </p>
 *
 * @author lqj
 * @since 2025-07-02
 */
@TableName("order_main")
@ApiModel(value="OrderMain对象", description="订单详情")
public class OrderMain implements Serializable {

    private static final long serialVersionUID = 1L;

        @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

        @ApiModelProperty(value = "收货地址_主键")
    @TableField("address_id")
    private Long addressId;

        @ApiModelProperty(value = "用户表_主键")
    @TableField("user_id")
    private Long userId;

        @ApiModelProperty(value = "订单号")
    @TableField("order_no")
    private String orderNo;

        @ApiModelProperty(value = "订单状态")
    @TableField("status")
    private Integer status;

        @ApiModelProperty(value = "订单总金额")
    @TableField("total_amount")
    private BigDecimal totalAmount;

        @ApiModelProperty(value = "实付金额")
    @TableField("payment_amount")
    private BigDecimal paymentAmount;

        @ApiModelProperty(value = "逻辑删除")
    @TableField("is_deleted")
        @TableLogic
    private Boolean deleted;

        @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

        @ApiModelProperty(value = "修改时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

        @ApiModelProperty(value = "物流公司")
    @TableField("company")
    private String company;

        @ApiModelProperty(value = "物流单号")
    @TableField("tracking_no")
    private String trackingNo;

        @ApiModelProperty(value = "物流状态")
    @TableField("logistics_status")
    private Integer logisticsStatus;

        @ApiModelProperty(value = "发货时间")
    @TableField("shipping_time")
    private LocalDateTime shippingTime;

        @ApiModelProperty(value = "签收时间")
    @TableField("delivery_time")
    private LocalDateTime deliveryTime;

        @ApiModelProperty(value = "订单商品_主键")
    @TableField("order_product_id")
    private Long orderProductId;

    @TableField(exist = false)
    private List<OrderItem> items;

    @TableField(exist = false)
    private DeliveryAddress deliveryAddress;

    public DeliveryAddress getDeliveryAddress() {
        return deliveryAddress;
    }

    public void setDeliveryAddress(DeliveryAddress deliveryAddress) {
        this.deliveryAddress = deliveryAddress;
    }

    public List<OrderItem> getItems() {
        return items;
    }

    public void setItems(List<OrderItem> items) {
        this.items = items;
    }

    public Long getId() {
        return id;
        }

            public OrderMain setId(Long id) {
        this.id = id;
            return this;
        }
        public Long getAddressId() {
        return addressId;
        }

            public OrderMain setAddressId(Long addressId) {
        this.addressId = addressId;
            return this;
        }
        public Long getUserId() {
        return userId;
        }

            public OrderMain setUserId(Long userId) {
        this.userId = userId;
            return this;
        }
        public String getOrderNo() {
        return orderNo;
        }

            public OrderMain setOrderNo(String orderNo) {
        this.orderNo = orderNo;
            return this;
        }
        public Integer getStatus() {
        return status;
        }

            public OrderMain setStatus(Integer status) {
        this.status = status;
            return this;
        }
        public BigDecimal getTotalAmount() {
        return totalAmount;
        }

            public OrderMain setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
            return this;
        }
        public BigDecimal getPaymentAmount() {
        return paymentAmount;
        }

            public OrderMain setPaymentAmount(BigDecimal paymentAmount) {
        this.paymentAmount = paymentAmount;
            return this;
        }
        public Boolean getDeleted() {
        return deleted;
        }

            public OrderMain setDeleted(Boolean deleted) {
        this.deleted = deleted;
            return this;
        }
        public LocalDateTime getCreateTime() {
        return createTime;
        }

            public OrderMain setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
            return this;
        }
        public LocalDateTime getUpdateTime() {
        return updateTime;
        }

            public OrderMain setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
            return this;
        }
        public String getCompany() {
        return company;
        }

            public OrderMain setCompany(String company) {
        this.company = company;
            return this;
        }
        public String getTrackingNo() {
        return trackingNo;
        }

            public OrderMain setTrackingNo(String trackingNo) {
        this.trackingNo = trackingNo;
            return this;
        }
        public Integer getLogisticsStatus() {
        return logisticsStatus;
        }

            public OrderMain setLogisticsStatus(Integer logisticsStatus) {
        this.logisticsStatus = logisticsStatus;
            return this;
        }
        public LocalDateTime getShippingTime() {
        return shippingTime;
        }

            public OrderMain setShippingTime(LocalDateTime shippingTime) {
        this.shippingTime = shippingTime;
            return this;
        }
        public LocalDateTime getDeliveryTime() {
        return deliveryTime;
        }

            public OrderMain setDeliveryTime(LocalDateTime deliveryTime) {
        this.deliveryTime = deliveryTime;
            return this;
        }
        public Long getOrderProductId() {
        return orderProductId;
        }

            public OrderMain setOrderProductId(Long orderProductId) {
        this.orderProductId = orderProductId;
            return this;
        }

    @Override
    public String toString() {
    return "OrderMain{" +
            "id=" + id +
            ", addressId=" + addressId +
            ", userId=" + userId +
            ", orderNo=" + orderNo +
            ", status=" + status +
            ", totalAmount=" + totalAmount +
            ", paymentAmount=" + paymentAmount +
            ", deleted=" + deleted +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", company=" + company +
            ", trackingNo=" + trackingNo +
            ", logisticsStatus=" + logisticsStatus +
            ", shippingTime=" + shippingTime +
            ", deliveryTime=" + deliveryTime +
            ", orderProductId=" + orderProductId +
    "}";
    }
}
